<?php

class Blog_Document_Blog extends Mongo_Document
{
	/**
	 * has alias
	 * @var bool
	 */
	protected $_hasAlias = true;

	/**
	 * collection name
	 * @var string
	 */
	protected $_name = 'blogs';

	public function getUrl()
	{
		return Agilet::getUrl('blog', $this -> alias);
	}

	public function getTitle()
	{
		return $this -> title;
	}

	public function __toString()
	{
		return sprintf('<a href="%s" title="%s">%s</a>', $this -> getUrl(), $this -> getTitle(), $this -> getTitle());
	}

}
